<template>
  <el-config-provider :locale="locale">
    <router-view v-if="isRouterAlive" />
  </el-config-provider>
</template>

<script setup>
import {nextTick, provide, ref} from "vue";
import zhCn from "element-plus/lib/locale/lang/zh-cn";

const locale = ref(zhCn);

const isRouterAlive = ref(true);

provide("reload", () => {
  isRouterAlive.value = false;
  nextTick(() => {
    isRouterAlive.value = true;
  });
});

</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100vh;
}
body {
  margin: 0 !important;
}
</style>
